import React from 'react';
import { ConfigProvider, Layout } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';

import BasicHeader from '@/components/BasicHeader';
import SubSystemHeader from '@/components/SubSystemHeader';
import styles from './BasicLayout.less';


const { Content } = Layout;

function BasicLayout({ children, location }) {
  // // if(location.pathname.startsWith('/login') ||
  // //   location.pathname.startsWith('/prelogin')) {
  // //   return <_layout>{ children }</_layout>
  // // } else
  // // if(location.pathname.startsWith('/subSystem')) {
  // //   return <SubSystemLayout>{ children }</SubSystemLayout>
  // // }
  // return (
  //   <ConfigProvider locale={zhCN}>
  //     <Layout className={styles.basicLayout}>
  //       {(location.pathname==='/'||location.pathname.startsWith('/subSystem1'))?(<BasicHeader></BasicHeader>):(<SubSystemHeader></SubSystemHeader>)}
  //       <Content className={styles.content}>
  //         {/*<Scrollbars autoHide>{ children }</Scrollbars>*/}
  //         { children }
  //       </Content>
  //       {/*<GlobalFooter/>*/}
  //     </Layout>
  //   </ConfigProvider>
  // );
  let header = (<BasicHeader></BasicHeader>);
  if(location.pathname.startsWith('/subSystemm')) {
    header = (<SubSystemHeader></SubSystemHeader>);
  }
  return (
    <ConfigProvider locale={zhCN}>
      <Layout className={styles.basicLayout}>
        {header}
        <Content className={styles.content}>
          { children }
        </Content>
      </Layout>
    </ConfigProvider>
  );
}

export default BasicLayout;
